//
//  MKTFuncItem.m
//  MKUITestApp
//
//  Created by sushangjin on 2020/6/1.
//  Copyright © 2020 sushangjin. All rights reserved.
//

#import "MKTFuncItem.h"

@implementation MKTFuncItem
+ (id)funcWithName:(NSString *)name iconImage:(UIImage *)iconImage viewControllerClass:(Class)viewControllerClass{
    MKTFuncItem *item = [[MKTFuncItem alloc] init];
    item.name = name;
    item.iconImage = iconImage;
    item.viewControllerClass = viewControllerClass;
    return item;
}
+ (id)funcWithName:(NSString *)name viewControllerClass:(Class)viewControllerClass{
    MKTFuncItem *item = [[MKTFuncItem alloc] init];
    item.name = name;
    item.viewControllerClass = viewControllerClass;
    return item;
}
- (UIViewController *)createViewController{
    UIViewController *v;
    if(self.viewControllerClass){
        v = (UIViewController *)[[self.viewControllerClass alloc] init];
    }
    return v;
}
@end
@implementation UITabBarItem(MKTFuncItem)
- (void)test_setValueWithFuncItem:(MKTFuncItem *)item{
    self.title = item.name;
    self.image = item.iconImage;
    self.selectedImage = item.selectedIconImage;
}
@end
